<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>文章管理</title>
    <link rel="stylesheet" href="/static/admin/css/style.css">
</head>
<body>

<div class="content">
    <div class="wrap cl">
        <!--导航栏-->
        {(admin/nav.html)}
        <!--导航栏-->
        <!--列表样式2-->

        <div class="details">
            <h3 class="details-title border-b">文章管理</h3>
            <div class="buildTab">
                <ul>
                    {% if status == 1 then %}
                        <li class="hover"><p><a href="/admin/post_list?page=1&rows=10&status=1">正常</a></p></li>
                        <li><p><a href="/admin/post_list?page=1&rows=10&status=0">已删除</a></p></li>
                    {% else %}
                        <li><p><a href="/admin/post_list?page=1&rows=10&status=1">正常</a></p></li>
                        <li class="hover"><p><a href="/admin/post_list?page=1&rows=10&status=0">已删除</a></p></li>
                    {% end %}
                </ul>
            </div>
            <!-- 账单列表begin -->
            <div class="buildCon" id="con-detail-1">
                <div class="buildBox br-none">
                    <dl class="detail-alerm cl br">
                        <dd><a class="inquire ml6" href="/admin/post_add">添加</a></dd>
                    </dl>
                    <div class="alermBox mb10" style="border-left:0;">
                        <table class="alermTable cool">
                            <colgroup>
                                <col width="5%">
                                <col width="35%">
                                <col width="10%">
                                <col width="10%">
                                <col width="10%">
                                <col width="10%">
                                <col width="20%">
                            </colgroup>
                            <thead>
                            <tr class="bg" style="background-color: rgb(235, 241, 245);">
                                <th>序号</th>
                                <th>文章标题</th>
                                <th>所属栏目</th>
                                <th>属性</th>
                                <th>添加时间</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <!--这里判断是否有文章-->
                            {% if #list > 0 then %}
                                {% for k, v in pairs(list) do %}
                                <tr>
                                    <td>{{v.id}}</td>
                                    <td>{{v.title}}</td>
                                    <td>{{v.cateName}}</td>
                                    <td>
                                        {% if v.flag == 0 then %}
                                            普通
                                        {% elseif v.flag == 1 then   %}
                                            <span style="color: orangered;">头条</span>
                                        {% elseif v.flag == 2 then   %}
                                            推荐
                                        {% elseif v.flag == 3 then   %}
                                            图文
                                        {% end %}
                                    </td>
                                    <td>{{os.date("%Y-%m-%d %H:%M:%S", v.pubtime)}}</td>
                                    <td>
                                        {% if v.status == 1 then %}
                                        正常
                                        {% else %}
                                        删除
                                        {% end %}
                                    </td>
                                    <td>
                                        {% if v.status == 1 then %}
                                        <a href="/admin/post_edit?id={{v.id}}" class="normal">修改</a>  |  <a target="_blank" href="/admin/posts_status?id={{v.id}}&status=0" class="normal">删除</a>
                                        {% else %}
                                        <a href="/admin/posts_status?id={{v.id}}&status=1" class="normal" target="_blank" >还原</a>
                                        {% end %}
                                    </td>
                                </tr>
                                {% end %}
                            {% else %}
                                <tr>
                                    <td colspan="6">没有数据</td>
                                </tr>
                            {% end %}
                            </tbody>
                        </table>
                    </div>
                </div>
                <!-- 分页begin -->
                <!-- 分页begin -->
                <div class="pages">
                    {% for k, v in pairs(page_list) do %}
                        {% if v.isCurrent then %}
                            <a href="{{v.path}}" class="page-item current">{{v.label}}</a>
                        {% else %}
                            <a href="{{v.path}}" class="page-item">{{v.label}}</a>
                        {% end %}
                    {% end %}
                </div>
                <!-- 分页end -->
                <!-- 分页end -->
            </div>

            <!-- 账单列表end -->
        </div>
        <!--列表样式2-->

    </div>
</div>


</body>
</html>